package com.shuai.user.service;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.io.IOException;

/**
 * 验证码工具类，用户向前端发送验证码，并验证验证码
 */
public interface CaptchaService {

    /**
     * 返回验证码给前端
     */
    void sendCaptcha(HttpServletRequest request, HttpServletResponse response) throws IOException;

    /**
     * 验证前端输入的验证码是否正确
     */
    boolean verifyCaptcha(String cookieValue, String captcha);

    void removeCaptcha(String captchaValue);

}
